//
//  HQVenderCell.m
//  MobileiOS
//
//  Created by 郝庆松 on 2018/5/12.
//  Copyright © 2018年 PCITC. All rights reserved.
//

#import "HQVenderCell.h"

@implementation HQVenderCell

/**
 生成Cell
 
 @param tableView 列表
 @return ***
 */
+(instancetype)cellWithTableView:(UITableView*)tableView{
    static NSString *CellIdentifer = @"HQVenderCell";
    HQVenderCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifer];
    if(!cell){
        [tableView registerNib:[UINib nibWithNibName:CellIdentifer bundle:nil] forCellReuseIdentifier:CellIdentifer];
        cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifer];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

/**
 数据源

 @param dataInfo 数据
 */
-(void)setDataInfo:(NSDictionary *)dataInfo{
    _dataInfo = dataInfo;
    _editButton.dataInfo = _dataInfo;
    _callPhone.dataInfo = _dataInfo;
    _shopName.text = _dataInfo[@"shop_name"];
    _address.text = [NSString stringWithFormat:@"厂家地址: %@",_dataInfo[@"address"]];
    _realNamePhone.text = [NSString stringWithFormat:@"联系人: %@ 电话: %@",_dataInfo[@"real_name"],_dataInfo[@"phone"]];
    _mainProduct.text = [NSString stringWithFormat:@"主营商品: %@",_dataInfo[@"range_desc"]];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
